import java.awt.*;
import java.awt.event.*;
import java.net.*;
import javax.swing.*;
public class JButtonDemo extends JFrame
{
	
	public JButtonDemo() throws Exception{
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100,100,600,500);
		setTitle("TITLE");
		getContentPane().setBackground(Color.WHITE);
		
		getContentPane().setLayout(new FlowLayout());
		
		//JButton with text
		JButton btn1 = new JButton("text");	
		
		//JButton with icon
		JButton btn2 = new JButton(new ImageIcon(new URL("http://imgsrc.baidu.com/forum/pic/item/eb742d9c31a3994cbd3109e9.jpg")));

		//JButton with text and icon
		JButton btn3 = new JButton("text",new ImageIcon(new URL("http://wenwen.soso.com/p/20110326/20110326185524-2114740343.jpg")));
		
		//not enabled JButton
		JButton btn4 = new JButton("not enabled button");
		btn4.setEnabled(false);
		
		JButton btn5 = new JButton("this btn impl action listener");
		btn5.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				JOptionPane.showMessageDialog(null,"chick button !!!");
			}
		});


		getContentPane().add(btn1);
		getContentPane().add(btn2);
		getContentPane().add(btn3);
		getContentPane().add(btn4);
		getContentPane().add(btn5);

	}


	public static void main(String[] args) throws Exception{
		new JButtonDemo().setVisible(true);	
	}
}
